{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<!-- <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/user_glb.css?version={$version}"> -->

<style type="text/css">
	body{
		padding-top:2.2rem;
	}
	#date{
		background-color:transparent;
	}
	/*input[type="date"]:before{
	    content: attr(placeholder);
	    color:#ccc;
	}*/
    input[type="date"]:before{
        content: attr(placeholder);
    }
</style>
{/block}
{block name="content"}
<form>
    {include file="../common_header.html"}
    <ul class="visit_from">
        <li class="clearfix">
            <label for="yin" class="fl">拟入驻园区</label>
            <input type="text" id="yin" name="incubator_name"  value="{$incubator_info.incubator_name}" readonly>
        </li>
        <li class="clearfix">
            <label for="date" class="fl">预约时间</label>
            <input type="date" id="date" name="order_time" value="" placeholder="请选择预约时间">
            <i class="fr icon icon_enter_default3x"></i>
        </li>
        <li class="clearfix">
            <label for="name" class="fl">公司/项目名称</label>
            <input type="text" id="name" name="company_name" value="" placeholder="请输入公司/项目名称">
        </li>
        <li class="clearfix">
            <label for="name_ren" class="fl">预约人姓名</label>
            <input type="text" id="name_ren" name="contacts" value="" placeholder="请输入预约人姓名">
        </li>
        <li class="clearfix">
            <label for="tell" class="fl">预约人电话</label>
            <input type="number" id="tell" name="contact_number" value="" placeholder="请输入联系人电话">
        </li>
        <li class="clearfix">
            <label for="number" class="fl">参观人数</label>
           <!-- <select name="" id="number">
                  <option value="请选择参观人数">请选择参观人数</option>
              </select>-->
            <input type="number" id="number" name="visit_num" value="" placeholder="请输入参观数量">
            <input type="hidden" value="order" name="opt">
            <input type="hidden" value="{$incubator_id}" name="incubator_id">
            <input type="hidden" value="{$type}" name="type">
        </li>

    </ul>
    <h6 class="bei">备注</h6>
    <textarea name="user_remarks" placeholder="请输入备注" class="bei_txt"></textarea>

</form>
<div class="submit_btn">提交</div>
{/block}
{block name="js"}
<script>
    incubator_id={$incubator_id}
</script>
{literal}

<!--<script type="text/javascript" src="/Public/Js/front/front_js/ajaxupload.3.5.js"></script>-->
<script type="text/javascript">
    $(function()
    {
       
        /*$(".service_header i,.service_header span").on("click",function()

        {
            history.go(-1);
            //window.location='/FrontIncubator/park_detail/incubator_id/'+incubator_id;
        });*/
        $(".submit_btn").on("click",function()
        {
            if($("#yin").val()=='')
            {
                layer.open({
                    content: '请输入预约园区',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
            if($("#name").val()=='')
            {
                layer.open({
                    content: '请输入公司/项目名称',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
            if($("#name_ren").val()=='')
            {
                layer.open({
                    content: '请输入预约人姓名',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
            if($("#tell").val()=='')
            {
                layer.open({
                    content: '请输入联系人电话',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
            $.ajax({
                type: 'POST',
                url: '/FrontIncubator/order_park_visit' ,
                data: $('form').serialize(),
                dataType:'json',
                success:function(data) {
                    console.log(data)
                    if(data.code == 1 ){
                        layer.open({
                            content:data.msg,
                            title: false,
                            btn: ['确定'],
                            yes:function(){
                                if(!is_wechat()){
                                    native_listen('back');
                                }else{
                                    history.go(-1);
                                }
                            }
                        });
                    }else{
                        layer.open({
                            content:data.msg,
                            title: false,
                            btn: ['确定']
                    });
                    }
                }
            })

        });
    });
    //date的placeholder兼容方案
    var i_date = document.getElementById('date');
    i_date.onfocus = function(){
        this.removeAttribute('placeholder');
    };
    i_date.onblur = function(){
        if(this.value == '') this.setAttribute('placeholder','请选择预约时间');
    };
</script>
</script>
{/literal}
{/block}